function(doc){
	if(doc.doctype == 'category'){
		var childs = new Array();
		for(var i = 0; i< doc.childs.length; i++){
			var subcat = new Object();
			subcat.name = doc.childs[i].name;
			subcat.code = doc.childs[i].code;
			childs.push(subcat);
		}
		emit(null, {name:doc.name, code:doc.code, childs:childs});	
	}
}